// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   getBalanceAmount.java

package stock;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class getBalanceAmount
{

	public getBalanceAmount()
	{
	}

	public double balanceAmount(String unit_db_name, String product)
	{
		double balance_amount = 0.0D;
		nseer_db dba = new nseer_db(unit_db_name);
		try
		{
			String sql = (new StringBuilder("select amount from stock_balance where product_ID='")).append(product).append("'").toString();
			ResultSet rs = dba.executeQuery(sql);
			if (rs.next())
				balance_amount = rs.getDouble("amount");
			else
				balance_amount = 0.0D;
			dba.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return balance_amount;
	}
}
